from core.basehandler import BaseHandler
from core.room import Room
from core.action import Action

class Sea7CaughtFish(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        #add inventory items

        # build list of actions
        self.add_action(Cook)
        
        self.add_action(Raw)    
        
    # return description of room.
    def get_description(self):
        return "Fortunately, your 165 IQ enables you to fasten a makeshift fishing line from the kite string and items in your backpack. You quickly land a large swordfish and savor the meal to come. But should you try to cook it first with the lighter? Or eat it raw? "
        
    # return image of room
    def get_image(self):
        return 'sea7caughtfish_pic.jpg'
    
    # return class to use to create a new instance of this room
    #def get_room_class(self):
        #return Sea7CaughtFish

class Sea7CaughtFishHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return Sea7CaughtFish
# define actions for this room

class Cook(Action):
    def __init__(self):
        Action.__init__(self, "Cook Fish")    # do basic initialization for every action
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'sea10boatfire'
    
    def get_description(self):
        return "Cook Fish"
    
    def do_action(self,game,room,request):
        room.inventory.clear()
        player = game.get_player()
        player.inventory.clear()

class Raw(Action):
    def __init__(self):
        Action.__init__(self, "Eat it Raw")
        
    def get_destination(self):
        return 'sea8hearhello'
    
    def get_description(self):
        return "Eat it Raw"
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"